package com.xms.sdk.data;

import com.xms.core.data.Entity;
import com.xms.core.exception.XmsException;
import com.xms.sdk.core.RetrieverParameter;
import com.xms.sdk.query.QueryMetadataDescriptor;

import java.sql.SQLException;
import java.util.List;
import java.util.UUID;

/**
 * <p>
 * 组织实体数据处理
 * </p>
 *
 * @author migo
 * @since 2021/9/1
 */
public interface IOrganizationDataProvider {
    // 新建记录
    UUID create(Entity entity) throws SQLException;

    // 批量新建记录
    boolean createMany(List<Entity> entities) throws SQLException;

    // 更新记录
    boolean update(Entity entity) throws SQLException;

    // 通过查询更新一批记录
    boolean update(Entity entity, RetrieverParameter parameters, QueryMetadataDescriptor metadataDescriptor) throws SQLException, XmsException;

    // 删除记录
    boolean delete(String name, UUID id) throws SQLException;
    // 删除记录
    boolean delete(String name, UUID id, String primarykey) throws SQLException;
}
